﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DAY02继承
{
    //图形类
    class Graph
    {
        public double lengh { get { return 11; } }
        public double wide { get { return 8; } }

    }
    //三角形
    class Trigon : Graph
    {
        public void perare1()
        {
            double p1 = lengh * 3;
            double a1 = (lengh * wide) / 2;
            Console.WriteLine("三角形周长为{0};面积为{1}", p1, a1);
        }
    }
    //四边形
    class quadrangle : Graph
    {
        public void perare2()
        {
            double p2 = (lengh * 2) + (wide * 2);
            double a2 = lengh * wide;
            Console.WriteLine("长方形的周长为{0}；面积为{1}", p2, a2);
        }
    }
}


